package com.biubiushop.util;

import java.io.Serializable;
import java.util.List;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 分页查询统一返回值
 * @author chenjia
 *
 * @param <E>
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class PageModel<E> implements Serializable{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	private int pageNo;
	
	private int pageSize;
	
	private int totalRecords;
	
	private int pageCount;
	
	private List<E> list;

	public PageModel(int pageNo, int pageSize, int totalRecords, List<E> list) {
		this.pageNo = pageNo;
		this.pageSize = pageSize;
		this.totalRecords = totalRecords;
		this.pageCount = (totalRecords - 1)/pageSize + 1;
		this.list = list;
	}
	
}
